#include<stdio.h>

bool perfect(int x)
{
		int counter=1;
		int sum=0;
		
		for(counter=1; counter<x; counter++)
		{
			if(x%counter==0)
				sum=sum+counter;
		}

		if(x==sum)
			return true;
		else
			return false;
}

void factor(int x)
{
		int counter=1;
		
		
		for(counter=1; counter<x; counter++)
		{
			if(x%counter==0)
				printf("%d ", counter);
		}

		return;


}

int main()
{
	int a,i=1;
	for(i=1; i<=10000; i++)
	{
		a=perfect(i);
		if(a==1){
			printf("%dis perfect because its factors are :\n", i);
			factor(i);
			printf("\n\n");
		}
	}
	 
	return 0;
}